/**
 * @file imath.c
 * @brief 用户进行的相关数学运算功能函数
 * 
 * @author dalin (dalin@robot.com)
 * @version 1.0
 * @date 2023-06-04
 * 
 * @copyright Copyright (c) 2023  OpenSir Tech.co, Ltd
 * 
 * @par 修改日志:
 * Date           Version     Author      Description
 * 2022-04-04     0.1         Mr.Lin      touch
 * 2023-06-04     1.0         yangsl      移植
 */



#ifndef __IMATH_H
#define __IMATH_H

#include "stdint.h"



typedef struct
{
	signed short x;
	signed short y;
	signed short z;
}s16_xyz_t;

typedef struct
{
	float x;
	float y;
	float z;
}f_xyz_t;

union _H2F{
    float fdata;
    uint8_t farray[4];
};

float hex2float(uint8_t *buf);
float char2float(uint8_t *buf);
float inv_sqrt(float x);
uint16_t limit_u16(uint16_t in ,uint16_t min ,uint16_t max);
uint8_t verify_result(f_xyz_t *_in_data , float templt);
void sif_xyz_memcopy(f_xyz_t *_out_data,f_xyz_t *_in_data);
void  sif_xyz_memset(f_xyz_t *_in_data,float value);
float f_abs(float f);
void delay(uint32_t time);

#endif /* __IMATH_H */

